package test0109;

public class Test01 {
    public static void main(String[] args) {
        // (1) 统计字符串中某个数字出现的次数
        String s = "1827314132131453645234323";
        int i = m(s, '3');
        System.out.println(i);
    }

    public static int m(String str, char x) {
        int count = 0;
        for (char c : str.toCharArray()) {
            if (c == x) {
                count++;
            }
        }
        return count;
    }
}
